@echo off
SETLOCAL enabledelayedexpansion
SET sh_folder="%~dp0"
PUSHD "%sh_folder%"
:: 文件夹列表（请在此处替换为你的实际路径）
set "source_folders="
set "source_folders=%source_folders% src\main\java\thrift\test\client"
set "source_folders=%source_folders% src\main\java\thrift\test\original\decorator"
set "source_folders=%source_folders% src\main\java\thrift\test\service"
:: 遍历每一个文件夹
for %%F in (%source_folders%) do (
    rem 检查文件夹是否存在
    if exist "%%F\" (
        echo DELETING: %%F
        :: 使用RMDIR命令删除文件夹及其所有内容
        RMDIR /s /q "%%F"
    ) else (
        echo NO EXISTS: %%F
    )
)

CALL gen-decorator-service.bat && ^
CALL mvn clean install && ^
CALL gen-thrift-thrifty.bat && ^
CALL gen-client-thrifty.bat && ^
CALL mvn clean install && ^
CALL gen-decorator-client-thrifty && ^
POPD
ENDLOCAL